<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model \yii2mod\rbac\models\BizRuleModel */
/* @var $form ActiveForm */
?>

<div class="rule-item-form">
    <?php echo  '$parentRegionId : ' .  $parentRegionId  ; ?>
    <?php $form = ActiveForm::begin(); ?>

        <?php echo $form->field($model, 'region_name')->label('区域名称!')->textInput(['maxlength' => 64]); ?>

        <?php
        //echo $form->field($model, 'region_type_id')->label('区域类型')->textInput();
        ?>


    <?php
        echo $form->field($model, 'region_type_id')->label('区域类型')->dropDownList(ArrayHelper::map($regionTypes,'id', 'region_type_name'));
        // 自定义样式
         //echo Html::dropDownList('username', null, ArrayHelper::map($regionTypes,'id', 'region_type_name'), ['class' => 'dropdownlist']);


    ?>

    <?php //$parentRegionId
    echo  $form->field($model, 'parent_region_id',['labelOptions'=>['style'=>'display:none']])->hiddenInput(['value'=>$parentRegionId]);

   // echo $form->field($model, 'region_type_id ')->textInput()->hiddenInput('ddd' )->label(false) ;
    ?>

    <div class="form-group"><!--跟新还是插入-->
        <?php echo Html::submitButton($model->getIsNewRecord() ? Yii::t('region', 'Create') : Yii::t('region', 'Update'), [
            'class' => $model->getIsNewRecord() ? 'btn btn-success' : 'btn btn-primary', ]); ?>
        <?php echo Html::a(Yii::t('region', 'Cancel'), Yii::$app->request->getReferrer(), ['class' => 'btn btn-default']); ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>